package eu.liquify.ui {
	import flash.net.SharedObject;
	public class PersistentUIItem extends UIItem {
		private static var currentID:int = 0;
		private static var so:SharedObject;
		
		public var id:String;
		public function PersistentUIItem(options:Object = null) {
			id = ""+(currentID++);
			super(options);
		}
		private function loadSO():void {
			if (!so) so = SharedObject.getLocal("PeristentUIItemSO");
		}
		protected function load(name:String):Object {
			loadSO();
			return so.data[id+"_"+name];
		}
		protected function save(name:String, value:Object):void {
			loadSO();
			so.setProperty(id+"_"+name, value);
		}
	}
}